<?php
// 定义学生姓名数组
$students = ["本人姓名", "张三", "李四", "王五", "赵六", "陈七", "刘八", "郑九", "钱十", "孙十一"];

// 生成带有学生姓名的随机成绩
$scores = [];
foreach ($students as $student) {
    $score = rand(0, 100);
    $scores[$student] = $score;
}
var_dump($scores);

// 按成绩从高到低进行排序
arsort($scores);

// 输出排序后的学生姓名和成绩
echo "排序后的学生姓名和成绩：<br>";
foreach ($scores as $student => $score) {
    echo $student . "：" . $score . "<br>";
}
